package com.xl.ssh.service;

import org.springframework.web.socket.WebSocketSession;

import java.io.IOException;

/**
 * @Author:XueH
 * @Description:
 * @Date:Created in 9:36 2023/9/1
 * @Modified By:
 */
public interface WebSSHService {

    /**
     * 初始化连接SSH通道
     *
     * @param session
     */
    public void initConnection(WebSocketSession session);


    /**
     * 连接SSH,发送指令
     *
     * @param buffer
     * @param session
     */
    public void recvHandle(String buffer, WebSocketSession session);


    /**
     * 发送指令
     *
     * @param session
     * @param buffer
     * @throws IOException
     */
    public void sendMessage(WebSocketSession session, byte[] buffer) throws IOException;

    /**
     * 关闭
     *
     * @param session
     */
    public void close(WebSocketSession session);
}
